package com.tledu.springboot19.service.impl;

import com.tledu.springboot19.dao.NewsDao;
import com.tledu.springboot19.entity.News;
import com.tledu.springboot19.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class NewsServiceImpl implements NewsService {
    @Autowired
    private NewsDao newsDao;


    @Override
    public List<News> search(String title) {
        return newsDao.newsList(title);
    }

    @Override
    public List<Map<String, Object>> countCategory() {
        return newsDao.countCategory();
    }

    @Override
    public List<Map<String, Object>> countByDate() {
        return newsDao.countByDate();
    }
}
